﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class TextFieldCollectionExtensions
    {
        public static bool Exists(this TextFieldCollection textFieldCollection, string textFieldIdOrNameOrValueorClass, bool extension = true)
        {
            return textFieldCollection.Exists(Find.ById(textFieldIdOrNameOrValueorClass)) ||
                textFieldCollection.Exists(Find.ByName(textFieldIdOrNameOrValueorClass)) ||
                textFieldCollection.Exists(Find.ByValue(textFieldIdOrNameOrValueorClass)) ||
                textFieldCollection.Exists(Find.ByClass(textFieldIdOrNameOrValueorClass)) ||
                textFieldCollection.Exists(Find.ByLabelText(textFieldIdOrNameOrValueorClass));
        }
    }
}